<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class project_participater_model extends MY_model {
	public function __construct() {
		parent::__construct ( 'project_participater' );
	}
	/**
	 * 创建数据表
	 */
	public function create() {
		$this->drop ();
		$sql = "CREATE TABLE `project_participater` (
				  `ppid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '众创项目参与id',
				  `pid` int(10) unsigned NOT NULL COMMENT '众创项目id',
				  `uid` int(10) unsigned NOT NULL COMMENT '用户ID',
				  `createtime` int(10) unsigned NOT NULL COMMENT '投资时间',
				  `isparticipater` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否是发起者（0：否；1：是）',
				  `check` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '众创项目参与审核状态（0：拉黑；1：未审核，2：审核通过）',
				  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '众创项目参与状态（0：删除；1：正常）',
				  PRIMARY KEY (`ppid`)
				) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='众创项目参与表';";
		$re = $this->db->simple_query ( $sql );
		return $re;
	}
	/**
	 * 删除数据表
	 */
	public function drop() {
		$sql = 'DROP TABLE IF EXISTS `project_participater`;';
		$re = $this->db->simple_query ( $sql );
		return $re;
	}
}